package model.game.items;

import java.io.Serializable;
import java.util.ArrayList;
import model.game.Player;
import model.effects.Consumable;
import model.effects.Heal;
import model.game.Item;

public class LifePotion implements Item, Serializable{
    private String name;
    private Item item;
    private int maximumStack;
    private boolean stackable;
    private int stack;
    public LifePotion(Player player, ArrayList<Item> items){
        Item i = new EndItem();
        i = new Heal(i, player, 20);
        i = new Consumable(i, items, this);
        this.item = i;
        this.name = "Life Potion";
        this.maximumStack = 20;
        this.stackable = true;
    }
    @Override
    public void use() {
        item.use();
    }

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getMaximumStack() {
        return maximumStack;
    }

    public void setMaximumStack(int maximumStack) {
        this.maximumStack = maximumStack;
    }

    public boolean isStackable() {
        return stackable;
    }

    public void setStackable(boolean stackable) {
        this.stackable = stackable;
    }

    public int getStack() {
        return stack;
    }

    public void setStack(int stack) {
        this.stack = stack;
    }

    @Override
    public Item changeOwner(Player player) {
        return new LifePotion(player, player.getItems());
    }

    @Override
    public int getPrice() {
        return 50;
    }

    
}
